<div
  local-class="
    row
    {{if @version.isHighestOfReleaseTrack "latest"}}
    {{if @version.yanked "yanked"}}
    {{if @version.isPrerelease "prerelease"}}
    {{if this.focused "focused"}}
  "
  ...attributes
>
  <div local-class="version">
    <div local-class="release-track" data-test-release-track>
      {{#if @version.yanked}}
        {{svg-jar "trash"}}
      {{else if @version.invalidSemver}}
        ?
      {{else if @version.isFirst}}
        {{svg-jar "star"}}
      {{else}}
        {{@version.releaseTrack}}
      {{/if}}

      <EmberTooltip @side="right" data-test-release-track-title>
        {{this.releaseTrackTitle}}
      </EmberTooltip>
    </div>

    <LinkTo
      @route="crate.version"
      @model={{@version.num}}
      local-class="num-link"
      {{on "focusin" (fn this.setFocused true)}}
      {{on "focusout" (fn this.setFocused false)}}
      data-test-release-track-link
    >
      {{@version.num}}
    </LinkTo>
  </div>

  <div local-class="metadata">
    <div local-class="metadata-row">
      {{#if @version.published_by}}
        <span local-class="publisher">
          by
          <LinkTo @route="user" @model={{@version.published_by.login}}>
            <UserAvatar @user={{@version.published_by}} local-class="avatar" />
            {{or @version.published_by.name @version.published_by.login}}
          </LinkTo>
        </span>
      {{/if}}

      <time
        datetime={{date-format-iso @version.updated_at}}
        local-class="date {{if @version.isNew "new"}}"
      >
        {{svg-jar "calendar"}}
        {{date-format-distance-to-now @version.created_at addSuffix=true}}

        <EmberTooltip>
          {{date-format @version.created_at 'PPP'}}
          {{#if @version.isNew}}
            (<span local-class="new">new</span>)
          {{/if}}
        </EmberTooltip>
      </time>
    </div>

    {{#if (or @version.crate_size @version.license @version.featureList)}}
      <div local-class="metadata-row">
        {{#if @version.msrv}}
          <span local-class="msrv">
            {{svg-jar "rust"}}
            v{{@version.msrv}}
          </span>
        {{/if}}

        {{#if @version.crate_size}}
          <span local-class="bytes">
            {{svg-jar "weight"}}
            {{pretty-bytes @version.crate_size}}
          </span>
        {{/if}}

        {{#if @version.license}}
          <span local-class="license">
            {{svg-jar "license"}}
            <LicenseExpression @license={{@version.license}} />
          </span>
        {{/if}}

        {{#if @version.featureList}}
          <span local-class="num-features" data-test-feature-list>
            {{svg-jar "checkbox"}}
            {{@version.featureList.length}} {{if (eq @version.featureList.length 1) "Feature" "Features"}}

            <EmberTooltip>
              <ul local-class="feature-list">
                {{#each @version.featureList as |feature|}}
                  <li>
                    {{svg-jar (if feature.isDefault "checkbox" "checkbox-empty")}}
                    {{feature.name}}
                  </li>
                {{/each}}
              </ul>
            </EmberTooltip>
          </span>
        {{/if}}
      </div>
    {{/if}}
  </div>

  <PrivilegedAction @userAuthorised={{this.isOwner}}>
    <YankButton @version={{@version}} local-class="yank-button" />
  </PrivilegedAction>
</div>